# See LICENSE file for copyright and license details.

include config.mk

SRC = t4.c
OBJ = $(SRC:.c=.o)

LIB = libt4.a
INC = t4.h

all: $(LIB)

$(LIB): $(OBJ)
	@$(AR) -rcs $@ $(OBJ)

.c.o:
	@$(CC) $(CFLAGS) -c $<

install: $(LIB) $(INC)
	@echo @ install libt4 to $(PREFIX)
	@mkdir -p $(PREFIX)/lib
	@cp $(LIB) $(PREFIX)/lib/$(LIB)
	@echo @ install t4.h to $(PREFIX)
	@mkdir -p $(PREFIX)/include/
	@cp $(INC) $(PREFIX)/include/

uninstall:
	@echo @ uninstall t4 from $(PREFIX)
	@rm -f $(PREFIX)/lib/$(LIB)
	@rm -f $(PREFIX)/include/$(INC)

clean:
	@rm -f $(LIB) $(OBJ)
